import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-news',
  templateUrl: './news.component.html',
  styleUrls: ['./news.component.css']
})

export class NewsComponent implements OnInit {

  title="新闻组件"

  public msg:string = '信息'

  public message:any;

  public student:string = '这是一个学生'

  content: string = '<h2>html解析</h2>'

  arr:string[] = ['111', '222', '333']
  arr1: Array<string> = ['111', '222', '333']

  
  lists: object[] = [
    {
      username: 'zhangsan',
      age: 20
    },
    {
      username: 'lisi',
      age: 22
    },
    {
      username: 'wangwu',
      age: 25
    }
  ]

  constructor() {
    // 在这里赋值
    this.message = '构造器里给属性赋值'

    // 获取值
    console.log(this.msg);
    
  }

  ngOnInit() {
  }

}
